package com.thinkgsp.jxc.service.impl;

import java.sql.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.thinkgsp.jxc.model.BillHistory;
import com.thinkgsp.jxc.persistence.BillHistoryMapper;
import com.thinkgsp.jxc.service.BillHistoryService;

@Service("billHistoryService")
public class BillHistoryServiceImpl implements BillHistoryService {

	@Autowired
	private BillHistoryMapper hisMapper;
	public List<BillHistory> getRecentSaleHistory(Integer custId,
			Integer productId) {
		return hisMapper.getRecentSaleHistory(custId, productId);
	}

	public List<BillHistory> getRecentPurchaseHistory(Integer productId) {
		return hisMapper.getRecentPurchaseHistory(productId);
	}

	public List<BillHistory> getSaleHistory(Date begDate, Date endDate,
			Integer productId, Integer custId) {
		return hisMapper.getSaleHistory(begDate, endDate, productId, custId);
	}

	public List<BillHistory> getPurchaseHistory(Date begDate, Date endDate,
			Integer productId, Integer custId) {
		return hisMapper.getPurchaseHistory(begDate, endDate, productId, custId);
	}

}
